package cn.com.jenson.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public final class AuthEntity {

    private String label;
    private List<String> children;

    public static List<AuthEntity> authList;

    public static List<String> toStringList(List<AuthEntity> authList) {
        List<String> list = new ArrayList<>();
        authList.forEach(item -> {
            item.children.forEach(children -> {
                StringBuilder stringBuilder = new StringBuilder();
                list.add(stringBuilder.append(item.getLabel()).append(":").append(children).toString());
            });
        });
        return list;
    }

}
